package com.ten.jinxiancun.controller;

import com.ten.jinxiancun.server.impl.PurchaseorderDetailsServerImpl;
import com.ten.jinxiancun.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
//采购订单明细
@RestController
@RequestMapping("/PurDeta")
public class PurchaseorderDetailsController {
    @Autowired
    PurchaseorderDetailsServerImpl purDta;

    @RequestMapping("/getAllPurDeta")
    public Object getAllPurDeta(@RequestParam Map<String, Object> map) {
        Integer limit = Integer.parseInt(map.get("limit").toString());
        Integer page = Integer.parseInt(map.get("page").toString());
        map.put("limit", limit);
        map.put("page", (page - 1) * limit);
        Result res = new Result("0", "true", purDta.countFind(map), purDta.getAllPurDeta(map));
        return res;
    }
}
